﻿using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace IOP.Orleans.TokenStorage
{
    /// <summary>
    /// 令牌加载器接口
    /// </summary>
    public interface ITokenRequest
    {
        /// <summary>
        /// 签发者
        /// </summary>
        public string Issuer { get; set; }
        /// <summary>
        /// 客户端ID
        /// </summary>
        public string ClientId { get; set; }
        /// <summary>
        /// HTTP客户端工厂
        /// </summary>
        public IHttpClientFactory HttpClientFactory { get; }
        /// <summary>
        /// 加载器函数
        /// </summary>
        public Func<Task<TokenStorage>> RequestHandle { get; }
        /// <summary>
        /// 注册加载器
        /// </summary>
        /// <param name="handle"></param>
        public void RegistRequestFunction(Func<Task<TokenStorage>> handle);
    }
}
